<?php
namespace Plugin\Attractions\Commerce\Schema\Commerce_energy;

use Plugin\Attractions\Commerce\Model\Commerce_energy\CommerceEnergy;
use Hyperf\Swagger\Annotation\Property;
use Hyperf\Swagger\Annotation\Schema;

/**
 * 商户能耗
 */
#[Schema(title: 'CommerceEnergySchema')]
class CommerceEnergySchema implements \JsonSerializable
{
    #[Property(property: 'id', title: '主键ID', type: 'bigint')]
    public string $id;

    #[Property(property: 'merchant_id', title: '商户ID', type: 'bigint')]
    public string $merchant_id;

    #[Property(property: 'consumption_month', title: '能耗月份（格式：2024-01）', type: 'varchar')]
    public string $consumption_month;

    #[Property(property: 'cost_type', title: '费用类型：1-水费，2-电费，3-气费，4-其他', type: 'int')]
    public string $cost_type;

    #[Property(property: 'cost_usage', title: '用量', type: 'decimal')]
    public string $cost_usage;

    #[Property(property: 'cost_price', title: '单价', type: 'decimal')]
    public string $cost_price;

    #[Property(property: 'cost_meter_reading', title: '表读数', type: 'decimal')]
    public string $cost_meter_reading;

    #[Property(property: 'total_amount', title: '总费用', type: 'decimal')]
    public string $total_amount;

    #[Property(property: 'payment_status', title: '缴费状态：1-未缴费，2-已缴费', type: 'tinyint')]
    public string $payment_status;

    #[Property(property: 'payment_date', title: '缴费日期', type: 'date')]
    public string $payment_date;

    #[Property(property: 'payment_method', title: '付款方式1-银行转账,2-微信支付,3-支付宝支付,4-现金,5-其他付款方式', type: 'tinyint')]
    public string $payment_method;

    #[Property(property: 'invoice_id', title: '发票号', type: 'varchar')]
    public string $invoice_id;

    #[Property(property: 'meter_photos', title: '抄表照片', type: 'varchar')]
    public string $meter_photos;

    #[Property(property: 'bills_photos', title: '账单照片', type: 'varchar')]
    public string $bills_photos;

    #[Property(property: 'remark', title: '备注', type: 'text')]
    public string $remark;

    #[Property(property: 'created_at', title: 'created_at', type: 'timestamp')]
    public string $created_at;

    #[Property(property: 'updated_at', title: 'updated_at', type: 'timestamp')]
    public string $updated_at;

    #[Property(property: 'deleted_at', title: 'deleted_at', type: 'timestamp')]
    public string $deleted_at;




    public function __construct(CommerceEnergy $model)
    {
       $this->id = $model->id;
       $this->merchant_id = $model->merchant_id;
       $this->consumption_month = $model->consumption_month;
       $this->cost_type = $model->cost_type;
       $this->cost_usage = $model->cost_usage;
       $this->cost_price = $model->cost_price;
       $this->cost_meter_reading = $model->cost_meter_reading;
       $this->total_amount = $model->total_amount;
       $this->payment_status = $model->payment_status;
       $this->payment_date = $model->payment_date;
       $this->payment_method = $model->payment_method;
       $this->invoice_id = $model->invoice_id;
       $this->meter_photos = $model->meter_photos;
       $this->bills_photos = $model->bills_photos;
       $this->remark = $model->remark;
       $this->created_at = $model->created_at;
       $this->updated_at = $model->updated_at;
       $this->deleted_at = $model->deleted_at;

    }

    public function jsonSerialize(): array
    {
        return ['id' => $this->id ,'merchant_id' => $this->merchant_id ,'consumption_month' => $this->consumption_month ,'cost_type' => $this->cost_type ,'cost_usage' => $this->cost_usage ,'cost_price' => $this->cost_price ,'cost_meter_reading' => $this->cost_meter_reading ,'total_amount' => $this->total_amount ,'payment_status' => $this->payment_status ,'payment_date' => $this->payment_date ,'payment_method' => $this->payment_method ,'invoice_id' => $this->invoice_id ,'meter_photos' => $this->meter_photos ,'bills_photos' => $this->bills_photos ,'remark' => $this->remark ,'created_at' => $this->created_at ,'updated_at' => $this->updated_at ,'deleted_at' => $this->deleted_at];
    }
}